package edu.tongji.structureplayer.core.test
{
    import edu.tongji.structureplayer.core.Solver;
    import edu.tongji.structureplayer.core.SolverI;
    import edu.tongji.structureplayer.structure.WellBehavedStructure;
    
    import flexunit.framework.Assert;
    
    public class TestSolver
    {		
        [Before]
        public function setUp():void
        {
        }
        
        [After]
        public function tearDown():void
        {
        }
        
        [BeforeClass]
        public static function setUpBeforeClass():void
        {
        }
        
        [AfterClass]
        public static function tearDownAfterClass():void
        {
        }
        
        [Test]
        public function testSolve():void
        {
            var structure:WellBehavedStructure = new WellBehavedStructure();
            structure.addNode("n0", 0, 1);
            structure.addNode("n1", 1, 1);
            structure.addNode("n2", 2, 0);
            structure.addMaterialProperty("mp0", 2, 1);
            structure.addSectionConstant("sc0", 4, 10);
            structure.addProperty("p0", "mp0", "sc0");
            structure.addConnection("c0", false, false, false);
            structure.addConnection("c1", true, true, true);
            structure.addConnection("c2", true, false, true);
            structure.addElement("e0", "n0", "n1", "p0", "c0", "c1");
            structure.addElement("n1", "n1", "n2", "p0", "c1", "c2");
            
            structure.addConnection("conn0", false, false, false);
            structure.addConnection("conn1", true, false, true);
            structure.addConstrain("cons0", "n0", "conn0");
            structure.addConstrain("cons1", "n2", "conn1");
            
            var solver:SolverI = new Solver();
            solver.solve(structure);
        }
    }
}